package com.itheima.utils;


import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import java.io.FileInputStream;
import java.util.List;

public class ExcelTest {

    public static void main(String[] args) throws Exception {
        /*XSSFWorkbook xssfWorkbook = new XSSFWorkbook(new FileInputStream("C:\\Users\\Sun\\Desktop\\hello.xlsx"));
        XSSFSheet sheet = xssfWorkbook.getSheetAt(0);
        XSSFRow row = sheet.getRow(0);
        System.out.println(row.getCell(0));
        xssfWorkbook.close();
        */
        List<String[]> list = POIUtils.readExcel(new FileInputStream("C:\\Users\\Sun\\Desktop\\hello.xlsx"), "hello.xlsx", 0);
        for (String[] strings : list) {
            for (String string : strings) {
                System.out.print(string+" ");
            }
            System.out.println("");
        }

    }

}
